package org.jiucai.app;

import java.io.IOException;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.jiucai.appframework.base.spring.web.BaseController;
import org.jiucai.cas.auth.util.UserUtil;
import org.jiucai.cas.domain.UserInfo;

public abstract class AppBaseController extends BaseController{

	/**
	 * 返回拼接了基路径的视图页面路径，方便迁移
	 * 
	 * @return
	 */
	public String getViewPath(String viewName) {
		StringBuffer viewPath = new StringBuffer("");

		viewPath.append("demo/");
		viewPath.append(viewName);

		return viewPath.toString();
	}

	public void initPage(Map<String, Object> view, HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {

		// 页头，页脚动态数据处理实现

		UserInfo authUser = UserUtil.getUser();
		view.put("sessAuthUser", authUser);

	}
}
